package DesignPrinciple.DepInversion.CorrectDIP;

import DesignPrinciple.DepInversion.CorrectDIP.inter.CPU;
import DesignPrinciple.DepInversion.CorrectDIP.inter.HardDisk;
import DesignPrinciple.DepInversion.CorrectDIP.inter.Memory;


public class ComputerDemo {
    public static void main(String[] args) {
        HardDisk hardDisk = new XiShuHardDisk();
        CPU cpu1 = new AmdCPU();
        CPU cpu2 = new IntelCPU();
        Memory memory = new KingStonMemory();

        Computer computer = new Computer();
        computer.setCpu(cpu1);
        computer.setMemory(memory);
        computer.setHardDisk(hardDisk);
        computer.run();

        computer.setCpu(cpu2);
        computer.run();
    }
}
